package com.airtight.objects;


import com.airtight.programs.TextureShaderProgram;

import static android.opengl.Matrix.orthoM;

public class Column extends Object{
    public boolean collidable = true;
    private boolean tighter = true;

    private final float[] columnMatrix = new float[16];
    private float transparency = 1f;


    public Column(float x, float y, float width, float height) {
        super(x,y,width,height);
        orthoM(columnMatrix, 0, -1f, 1f, -1, 1, -1, 1f);
    }

    public void drawColumn(TextureShaderProgram textureProgram, int asset){
        textureProgram.useProgram();
        textureProgram.setTexture(columnMatrix, asset);
        textureProgram.setOpacity(transparency);
        bindData(textureProgram);
        draw();
    }

    public float getX(){
        return columnMatrix[12];
    }

    public void setX(float x){
        columnMatrix[12] = x;
    }

    public float getY(){
        return columnMatrix[13];
    }

    public void setY(float y){
        columnMatrix[13] = y;
    }

    public float[] getMatrix(){
        return columnMatrix;
    }

    public boolean getTighter(){
        return tighter;
    }

    public void setTighter(boolean x){
        tighter = x;
    }

}
